Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pool reward tx #298

Merged
merged 4 commits into from
Jan 8, 2024
Merged

Support pool reward tx #298

merged 4 commits into from
Jan 8, 2024

Conversation

Lbqds
Copy link
Member

@Lbqds Lbqds commented Jan 8, 2024

No description provided.

@Lbqds Lbqds requested a review from polarker January 8, 2024 02:54
Copy link
Member

@polarker polarker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's transfer to every address 1 ALPH from the testWallet in the integration test, so that we test the pool reward case there.

for (const input of tx.unsigned.inputs) {
try {
const address = getAddressFromUnlockScript(input.unlockScript)
inputAddresses.push(address)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There might be duplicated addresses in tx inputs

@@ -24,7 +24,7 @@ import {
getSenderAddress,
getALPHDepositInfo,
isSimpleALPHTransferTx,
isSimpleTransferTokenTx,
isSimpleTokenTransferTx,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about removing these two isSimple* functions? They are not recommended for exchanges now.

@@ -208,8 +208,8 @@ class Exchange {
async handleBlock(block: node.BlockEntry, resolver: () => void) {
for (const tx of block.transactions) {
if (isSimpleALPHTransferTx(tx)) {
const { targetAddress, depositAmount } = getALPHDepositInfo(tx)
if (this.hotAddresses.includes(targetAddress)) {
const infos = getALPHDepositInfo(tx).filter((v) => this.hotAddresses.includes(v.targetAddress))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should replace isSimpleALPHTransferTx with the new validation function.

@Lbqds Lbqds merged commit 1759993 into master Jan 8, 2024
7 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants